package api

import (
    "github.com/gin-gonic/gin"
    "yi-shou-backstage/errmsg"
    "yi-shou-backstage/module"
)

// 新增频道
func CreateChannelApi(ctx *gin.Context) {
    code, msg, data := module.CreateChannelControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}

// 获取文章频道
func ListChannelsApi(ctx *gin.Context) {
    code, msg, data := module.ListChannelsControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}